<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建简单的水平布局</title>
</head>

<style>
.nav{
    display: flex;
}

#red,#green,#blue{
    flex-grow: 1;
    height: 500px;
}

#red{
    background-color:red;
}

#green{
    background-color:green;
}

#blue{
    background-color:blue;
}
</style>

<body>
    <div class="nav">
        <div id="red"></div>
        <div id="green"></div>
        <div id="blue"></div>
    </div>
</body>
</html>